Version

MeetsCriteria(FilterCondition[],FilterLogicalOperator) Method

Returns true if the row meets the criteria specified by the passed in filter conditions and the logical operator. If the logical operator is And and the row meets all the conditions in the filterConditions array then this method returns true. If the logical operator is Or and the row meets at least one filter condition then this method returns true. Otherwise it returns false.
Syntax
'Declaration
 
Public Overloads Function MeetsCriteria( _
   ByVal filterConditions() As FilterCondition, _
   ByVal logicalOperator As FilterLogicalOperator _
) As Boolean

Parameters

filterConditions
Filter conditions.
logicalOperator
Logical operator to combine filter conditions in the filter conditions array.

Return Value

true if the row meets the criteria of the FilterCondition, false if it does not.
Remarks

Returns true if the row meets the criteria specified by the passed in filter conditions and the logical operator. If the logical operator is And and the row meets all the conditions in the filterConditions array then this method returns true. If the logical operator is Or and the row meets at least one filter condition then this method returns true. Otherwise it returns false.

Example
Following sample code shows a typical usage for MeetsCriteria method. It will filter out rows so that only the rows whose CustomerID field begins with either the letter 'A' or the letter 'B' will be displayed. It uses the overload of MeetsCriteria that takes in an array of FilterCondition objects and a logical operator that specifies whether to logically or the conditions or and the conditions.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' Call RefreshFilters to cause the UltraGrid to reevaluate any filters and fire
        ' FilterRow event on every row.
        '
        e.Layout.RefreshFilters()
    End Sub

    Private Sub UltraGrid1_FilterRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.FilterRowEventArgs) Handles UltraGrid1.FilterRow
        Dim band As UltraGridBand = e.Row.Band
        If "Customers" = band.Key Then
            Dim fc1 As FilterCondition = New FilterCondition(band.Columns("CustomerID"), FilterComparisionOperator.Like, "A*")
            Dim fc2 As FilterCondition = New FilterCondition(band.Columns("CustomerID"), FilterComparisionOperator.Like, "B*")

            ' Call MeetsCriteria off the row with the filter logical operator of Or to test if the row
            ' passes any of the filters specified in the filter conditions array.
            '
            Dim rowPasses As Boolean = e.Row.MeetsCriteria(New FilterCondition() {fc1, fc2}, FilterLogicalOperator.Or)

            ' If the row does not pass the filter then filter it out otherwise reset its RowFilteredOut
            ' status.
            '
            If Not rowPasses Then
                e.RowFilteredOut = True

            Else
                e.RowFilteredOut = False
            End If
        End If
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Call RefreshFilters to cause the UltraGrid to reevaluate any filters and fire
			// FilterRow event on every row.
			//
			e.Layout.RefreshFilters( );
		}

		private void ultraGrid1_FilterRow(object sender, Infragistics.Win.UltraWinGrid.FilterRowEventArgs e)
		{
			UltraGridBand band = e.Row.Band;
			if ( "Customers" == band.Key )
			{
				FilterCondition fc1 = new FilterCondition( band.Columns[ "CustomerID" ], FilterComparisionOperator.Like, "A*" );
				FilterCondition fc2 = new FilterCondition( band.Columns[ "CustomerID" ], FilterComparisionOperator.Like, "B*" );

				// Call MeetsCriteria off the row with the filter logical operator of Or to test if the row
				// passes any of the filters specified in the filter conditions array.
				//
				bool rowPasses = e.Row.MeetsCriteria( new FilterCondition[] { fc1, fc2 }, FilterLogicalOperator.Or );

				// If the row does not pass the filter then filter it out otherwise reset its RowFilteredOut
				// status.
				//
				if ( ! rowPasses )
					e.RowFilteredOut = true;
				else
					e.RowFilteredOut = false;
			}
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also